﻿<%@ page language="java" import="com.talkweb.ncfw.web.utils.tree.TreeUtils" pageEncoding="UTF-8"%>
<%@ include file="/foundation/ext/jsp/taglib.jsp"%>
<%@ include file="/foundation/ext/jsp/workspace.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>数据字典管理</title>
<style>
</style>
	<script type="text/javascript" src="<%=basePath%>foundation/ext/ext-plugins/SearchField.js"></script>
	<script type="text/javascript" src="<%=basePath%>foundation/ext/ext-plugins/TreeNodeSearch.js"></script>
    <script type="text/javascript">
	var pageSize 					= 100;
	var findDictTypeSupportTreeUrl	= sys.basePath + 'systemdict/findDictTypeSupportTree.do';
	var listDictEntryUrl 			= sys.basePath + 'systemdict/listDictEntry.do';
	var addDictTypeUrl				= sys.basePath + 'systemdict/addDictType.do';
	var updateDictTypeUrl			= sys.basePath + 'systemdict/updateDictType.do';
	var deleteDictTypeUrl			= sys.basePath + 'systemdict/deleteDictType.do';
	var addDictEntryUrl				= sys.basePath + 'systemdict/addDictEntry.do';
	var updateDictEntryUrl			= sys.basePath + 'systemdict/updateDictEntry.do';
	var deleteDictEntryUrl			= sys.basePath + 'systemdict/deleteDictEntry.do';
	var refreshDictCacheUrl			= sys.basePath + 'systemdict/refreshDictCache.do';
	var dictTypeInputWindow, dictEntryInputWindow;
	var dictTypeInputForm, dictEntryInputForm;
	var optype;
    var treeRootId					= "<%=TreeUtils.treeRootId%>";
    var currentActiveNode;
	
	//------------------------------------------------------------------------//
	// 数据字典类型管理开始
	//------------------------------------------------------------------------//
	
	//获取数据字典类型录入表单
	function getDictTypeInputForm(){
		if(dictTypeInputForm == null){
			dictTypeInputForm = new Ext.FormPanel({
				id: 'dictTypeInputForm',
				region: 'center',
				bodyStyle: 'padding:5px; overflow-x:visible;overflow-y:scroll',
				autoScroll: true,
				border    : false,
		        frame: false,
		        labelAlign: 'right',
		        labelWidth: 86,	      
	        	labelWidth: 96,
				items : [{
					layout:'column',border:false,labelSeparator:':',
				  	defaults:{layout: 'form',border:false,columnWidth:1.00, width:30},
				  	items : [{
				  		items: [{
				  			xtype: 'hidden', id: 'dictType.parentId', name: 'parentId'
				  		},{
				  			xtype:'textfield', fieldLabel: '父字典类型', disabled: true,
				  			name:'parentName', id: 'dictType.parentName', anchor: Common.config.fieldAnchor, allowBlank : true				  			
				  		}]
				  	},{
				  		items: [{
				  			xtype:'textfield', fieldLabel: Common.config.redStar + '字典类型编号', 
				  			name:'dicttypeId', id: 'dictType.dicttypeId', anchor: Common.config.fieldAnchor, allowBlank : false, 
				  			maxLength: 255, maxLengthText: '键值长度不能超过255个字符'
				  		}]
				  	},{
				  		items: [{
				  			xtype:'textfield', fieldLabel: Common.config.redStar + '字典类型名称', 
				  			name: 'dicttypeName', id: 'dictType.dicttypeName', anchor: Common.config.fieldAnchor, allowBlank : false, 
				  			maxLength: 255, maxLengthText: '名称长度不能超过255个字符'
				  		}]
				  	}]
				}]
			});
		}
		return dictTypeInputForm;
	}
	
	//显示数据字典类型对话框
	function showDictTypeInputWindow(){
	  	if(dictTypeInputWindow == null){
	  		var localDictTypeInputForm = getDictTypeInputForm();
			dictTypeInputWindow = new Ext.Window({ //定义对话框
	  			id: 'dictTypeInputWindow',
				title: '数据字典类型录入',
				width : 520,
				height : 166,
				layout:'fit',
				plain    : true,
				shadow : true,
				closeAction : 'hide', //hide表示关闭的时候对话框是隐藏的，并没有真正的销毁，下次要用时在show出来
				modal : true,
				closable : true,
				items: [localDictTypeInputForm],
				buttons : [{
					text :'保存',
					iconCls: 'icon_save',
					handler: onSaveDictType
				},{
					text : '关闭',
					iconCls: 'icon_close',
					handler : function (){dictTypeInputWindow.hide()}
				}]
			});
        }
        dictTypeInputWindow.show(); 
	}
	
	//保存数据字典类型信息
	function onSaveDictType(){
		var thisForm = getDictTypeInputForm().getForm();
    	if(!thisForm.isValid()){
    		return;
    	}
		submitDictTypeInputForm();
	}
	
	function submitDictTypeInputForm(){
		var thisForm = getDictTypeInputForm().getForm();
		Common.showProcessMsgBox();
		var url = optype == Common.optype.add ? addDictTypeUrl : updateDictTypeUrl;
		thisForm.findField("dictType.dicttypeId").enable();
    	thisForm.submit({
    		url	: url,
    		params : {optype : optype},
			timeout: 300000,
		 	success: function(form, action) {
				Common.hideProcessMsgBox();
				Ext.Msg.show({
	                title : '成功提示',
	                msg : action.result.msg,
	                minWidth: 160,
	                buttons : Ext.Msg.OK,
	                icon: Ext.MessageBox.INFO,
	                fn: function(){
	  					if (optype == Common.optype.add) {
	  						currentActiveNode.appendChild(new Ext.tree.AsyncTreeNode({
	  							id	: form.findField("dictType.dicttypeId").getValue(),
	  							text: form.findField("dictType.dicttypeName").getValue(),
	  							leaf: true
	  						}));
	  					} else {
	  						currentActiveNode.setText(form.findField("dictType.dicttypeName").getValue());
	  					}
	                	dictTypeInputWindow.hide();
	  					form.reset();
	                }
	            });
	            
			},
			failure: function(form, action) {
				Common.hideProcessMsgBox();
	           	Ext.Msg.show({
	                title : '失败提示',
	                minWidth: 160,
	                msg : "数据字典类型保存失败",
	                buttons : Ext.Msg.OK,
	                icon: Ext.MessageBox.ERROR
	            });
	            if (optype == Common.optype.update) {
	            	thisForm.findField("dictType.dicttypeId").disable();
	            }
			}
		});	
	}
	
	//添加数据字典类型
	function onAddDictType(){
		optype = Common.optype.add;
		showDictTypeInputWindow();
		Ext.getCmp("dictType.dicttypeId").enable();
		dictTypeInputWindow.setTitle("新增数据字典类型");
		var dictTypeForm = getDictTypeInputForm().getForm();
		dictTypeForm.reset();
		dictTypeForm.findField("dictType.parentId").setValue(currentActiveNode.id);
		dictTypeForm.findField("dictType.parentName").setValue(currentActiveNode.text);
	}
	
	//修改数据字典类型
	function onUpdateDictType(){
		optype = Common.optype.update;
		showDictTypeInputWindow();
		Ext.getCmp("dictType.dicttypeId").disable();
		dictTypeInputWindow.setTitle("修改数据字典类型");
		initDictTypeInputForm();
	}
	
	//初始化数据字典类型录入表单
	function initDictTypeInputForm(){
		var values = [
			{id: 'dictType.dicttypeId', value: currentActiveNode.id}, {id: 'dictType.dicttypeName', value: currentActiveNode.text},
			{id: 'dictType.parentId', value: currentActiveNode.parentNode.id}, {id: 'dictType.parentName', value: currentActiveNode.parentNode.text}
		]
		var dictTypeInputForm = getDictTypeInputForm().getForm();
		dictTypeInputForm.setValues(values);
	}
	
	//删除数据字典类型
	function onDeleteDictType(){
		if (currentActiveNode.hasChildNodes()) {
			Ext.Msg.alert("提示信息", "请先删除此字典类型下的子字典类型");
			return;
		}
    	Ext.Msg.confirm("确认消息框", "此操作将删除数据字典类型信息，是否继续？", function(btn){
	 		if(btn == 'yes'){
				var dicttypeIds = currentActiveNode.id;
				Common.showProcessMsgBox('数据删除中，请稍后...');				
				Ext.Ajax.request({
					url: deleteDictTypeUrl,
					timeout: 300000,
					params:{dicttypeIds: dicttypeIds},
					success: function(response, options){
						Common.hideProcessMsgBox();
						var result = Ext.util.JSON.decode(response.responseText);
						if(result.success){
							Ext.Msg.show({
				                title : '成功提示',
				                msg : result.msg,
				                buttons : Ext.Msg.OK,
				                icon: Ext.MessageBox.INFO,
				                fn: function(){
				                	currentActiveNode.parentNode.removeChild(currentActiveNode);
				                	dictEntryStore.removeAll();
									dictEntryGrid.setTitle(dictEntryGridTitle);
				                }
				            });
				         } else {
				         	Ext.Msg.show({
				                title : '失败提示',
				                msg : result.msg,
				                buttons : Ext.Msg.OK,
				                icon: Ext.MessageBox.ERROR,
				                fn: function(){
				                }
				            });
				         }
					},
					failure:function(){Ext.MessageBox.hide();return;}
				});
		 	}
		});	
	}
	
	//------------------------------------------------------------------------//
	// 数据字典类型管理结束
	//------------------------------------------------------------------------//
    
    
	//------------------------------------------------------------------------//
	// 数据字典项管理开始
	//------------------------------------------------------------------------//
	
  	var dictEntryGridTitle = '数据字典项列表';
  	var _dictTypeId = null;
	var _dictTypeName = null;
	
	var dictEntryStatusDictArray = <ncfw:dictWrite dicttypeId="T_PUB_DICT_STATUS" type="array"/>;
	
	var dictEntryStatusCombo = new Ext.form.ComboBox({
    	hideLabel: false, fieldLabel: Common.config.redStar + '状态', width: 100, id: 'dictEntryStatusCombo',
		name: 'statusText', hiddenName: 'status', allowBlank: false, value: '1',
		store: new Ext.data.SimpleStore({
			fields: ['value', 'text'],
			data: dictEntryStatusDictArray
		}),
		mode: 'local',triggerAction: 'all',valueField: 'value',
		displayField: 'text',readOnly: true, resizable: true
	});
	
    //获取数据字典类型项录入表单
	function getDictEntryInputForm(){
		if(dictEntryInputForm == null){
			dictEntryInputForm = new Ext.FormPanel({
				region: 'center',
				bodyStyle: 'padding:5px; overflow-x:visible;overflow-y:scroll',
				autoScroll: true,
				border    : false,
		        frame: false,
		        labelAlign: 'right',
		        labelWidth: 86,	      
				items : [
				  {layout:'column',border:false,labelSeparator:':',
				  defaults:{layout: 'form',border:false,columnWidth: 1.0},
				  items : [
	                	{id: 'dictIdContainer', items: [
	                		{xtype:'hidden', name:'dicttypeId', id:'dictEntry.dicttypeId'},
	                		{xtype:'textfield',fieldLabel: Common.config.redStar + '字典项编号', anchor: Common.config.fieldAnchor, name:'dictId', id:'dictEntry.dictId',  allowBlank: false}
	                	]},
	                	{items: [
	                		{xtype:'textfield',fieldLabel: Common.config.redStar + '字典项名称', anchor: Common.config.fieldAnchor, name:'dictName', id:'dictEntry.dictName', allowBlank: false}
	                	]},
	                	
	                	{items: [dictEntryStatusCombo]},
	                	{items: [
	                		{xtype:'numberfield',fieldLabel: '显示序号', name:'sortNo', anchor: Common.config.fieldAnchor, id:'dictEntry.sortNo', readOnly: false}
	                	]},
						{items: [{xtype:'textarea', fieldLabel: '备忘', name:'memo', anchor: Common.config.fieldAnchor, id: 'dictEntry.memo', allowBlank : true, maxLength: 1024, maxLengthText: '备注长度不能超过1024个字符'}]}
					]
				}]
			});
		}
		return dictEntryInputForm;
	}
	
	//显示数据字典项录入对话框
	function showDictEntryInputWindow(){
	  	if(dictEntryInputWindow == null){
	  		var localDictEntryInputForm = getDictEntryInputForm();
			dictEntryInputWindow = new Ext.Window({ //定义对话框
				width : 520,
				height : 260,
				closeAction : 'hide',
				modal : true,
				shadow : true,
				closable : true,
				plain    : true,
				layout : 'fit',
				minWidth : 520,
				minHeight : 250,
				items:[localDictEntryInputForm],
				buttons : [{
					text :'保存',
					iconCls: 'icon_save',
					handler: onSaveDictEntry
				},{
					text : '关闭',
					iconCls: 'icon_close',
					handler : function (){dictEntryInputWindow.hide()}
				}]
			});
        }
        dictEntryInputWindow.show(); 
	}
	
	function submitSearchDictHandler () {
		var thisForm = queryFormPanel.getForm();
   	   	if (!thisForm.isValid()) {
			return;
   	   	}
   	   	if (!currentActiveNode) {
   	   		Ext.Msg.alert("提示信息", "请先选择字典类型");
			return;
   	   	}
  	   	var baseParamsStr = Ext.util.JSON.encode(thisForm.getValues());
	   	baseParamsStr = baseParamsStr.replace(/(query\.)/g, "");
		var baseParams = Ext.util.JSON.decode(baseParamsStr);
   	   	dictEntryStore.baseParams = baseParams;
		dictEntryStore.load({params:{start: 0, limit: dictEntryPagingBar.pageSize}});
	}
	
	//按所属数据字典类型查找数据字典项
	function searchDictEntry(dictTypeId, dictTypeName){
		_dictTypeId = dictTypeId;
		_dictTypeName = dictTypeName;
		dictEntryGrid.setTitle(dictEntryGridTitle + " (所属数据字典类型：" + _dictTypeName + ")");
		dictEntryStore.baseParams = {
			dicttypeId: _dictTypeId
		};
		dictEntryStore.load({params:{start: 0, limit: dictEntryPagingBar.pageSize}});
	}
	
	function refreshDictCache(){
	    Ext.Ajax.request({
			url: refreshDictCacheUrl,
			timeout: 300000,
			success: function(response, options){
				Ext.MessageBox.hide();
				var result = Ext.util.JSON.decode(response.responseText);
				Ext.topShow.msg("成功提示", result.msg);
			},
			failure:function(){Ext.MessageBox.hide();return;}
		});
	}
	
	//保存数据字典项
	function onSaveDictEntry(){
		var thisForm = getDictEntryInputForm().getForm();
    	if(!thisForm.isValid()){
    		return;
    	}
		submitDictEntryInputForm();
	}
	
	function submitDictEntryInputForm () {
		var thisForm = getDictEntryInputForm().getForm();
		var url = null;
		var url = optype == Common.optype.add ? addDictEntryUrl : updateDictEntryUrl;
		thisForm.findField("dictEntry.dictId").enable();
		Common.showProcessMsgBox();
    	thisForm.submit({
    		url: url,
			timeout: 300000,
			params: {'optype': optype},
		 	success: function(form, action) {
				Common.hideProcessMsgBox();
				Ext.Msg.show({
	                title : '成功提示',
	                msg : action.result.msg,
	                width: 180,
	                buttons : Ext.Msg.OK,
	                icon: Ext.MessageBox.INFO,
	                fn: function(){
						dictEntryStore.reload({});
						if(optype == Common.optype.update){
							dictEntryInputWindow.hide();
						}
	  					form.reset();
						form.findField("dictEntry.dicttypeId").setValue(_dictTypeId);
	                }
	            });
	            
			},
			failure: function(form, action) {
				Common.hideProcessMsgBox();
	           	Ext.Msg.show({
	                title : '失败提示',
	                msg : action.result.msg,
	                buttons : Ext.Msg.OK,
	                icon: Ext.MessageBox.ERROR
	            });
	            if (Common.optype.update) {
					thisForm.findField("dictEntry.dictId").disable();
	            }
			}
		});
	}
	
	//添加数据字典项
	function onAddDictEntry(){
		if(_dictTypeId == null || _dictTypeId == ""){
			Ext.Msg.alert("提示信息", "请先选择数据字典类型.");
			return;
		} else if(dictTypeId == treeRootId){
			Ext.Msg.alert("提示信息", "不能在字典类型根节点下直接添加字典项.");
			return;
		}
		optype = Common.optype.add;
		showDictEntryInputWindow();
		dictEntryInputWindow.setTitle("新增数据字典项");
		getDictEntryInputForm().getForm().reset();
		getDictEntryInputForm().getForm().findField("dictEntry.dicttypeId").setValue(_dictTypeId);
	}
	
	//修改数据字典项
	function onUpdateDictEntry(){
		var selectionModel = dictEntryGrid.getSelectionModel();
		var count = selectionModel.getCount();
		if(count != 1){
			Ext.Msg.alert("提示信息", "请选择一条记录进行修改！");
			return;
		}
		var dictEntryRecord = selectionModel.getSelected();
		optype = Common.optype.update;
		showDictEntryInputWindow();
		dictEntryInputWindow.setTitle("修改数据字典项");
		var values = [
			{id: 'dictEntry.dicttypeId', value: dictEntryRecord.get("dicttypeId")}, {id: 'dictEntry.dictId', value: dictEntryRecord.get("dictId")},
			{id: 'dictEntry.dictName', value: dictEntryRecord.get("dictName")}, {id: 'dictEntry.sortNo', value: dictEntryRecord.get("sortNo")},
			{id: 'dictEntry.memo', value: dictEntryRecord.get("memo")}, {id: 'dictEntryStatusCombo', value: dictEntryRecord.get("status")}
		]
		var dictEntryInputForm = getDictEntryInputForm().getForm();
		dictEntryInputForm.setValues(values);
		dictEntryInputForm.findField("dictEntry.dictId").disable();
	}
	
	//删除数据字典项
	function onDeleteDictEntry(){
		var selectionModel = dictEntryGrid.getSelectionModel();
		var count = selectionModel.getCount();
		if(count < 1){
			Ext.Msg.alert("提示信息", "请至少选择一条记录");
			return;
		}
    	Ext.Msg.confirm("确认消息框", "此操作将删除数据字典项信息，是否继续？", function(btn){
	 		if(btn == 'yes'){
				var records = selectionModel.getSelections();
				var pks = "";
				for(var i = 0;i < records.length;i++){
					pks += _dictTypeId + "," + records[i].get("dictId");
					if((i + 1) < records.length){
						pks += ";";
					}
				}
				Common.showProcessMsgBox('数据删除中，请稍后...');
			    Ext.Ajax.request({
					url: deleteDictEntryUrl,
					timeout: 300000,
					params:{pks : pks},
					success: function(response, options){
						Common.hideProcessMsgBox();
						var result = Ext.util.JSON.decode(response.responseText);
						if(result.success){
							Ext.Msg.show({
				                title : '成功提示',
				                msg : result.msg,
				                buttons : Ext.Msg.OK,
				                icon: Ext.MessageBox.INFO,
				                fn: function(){
				                	dictEntryStore.reload();
				                }
				            });
				         } else {
				         	Ext.Msg.show({
				                title : '失败提示',
				                msg : result.msg,
				                buttons : Ext.Msg.OK,
				                icon: Ext.MessageBox.ERROR,
				                fn: function(){
				                }
				            });
				         }
					},
					failure:function(){Ext.MessageBox.hide();return;}
				});
		 	}
		});	
	}
	
	
	//菜单点击事件
    function treeNodeClick(node, ev){
    	queryFormPanel.getForm().reset();
	    currentActiveNode = node;
	    searchDictEntry(currentActiveNode.id, currentActiveNode.text);
    }

    //初始化页面信息
	function initPage () {
		var menuTop1 = new Ext.menu.Menu({
		 	items:[
			 	{text: '增加子字典类型',iconCls : 'icon_add',handler: onAddDictType}
		 	]
		});
		var menuTop2 = new Ext.menu.Menu({
		 	items:[
			 	{text: '增加子字典类型',iconCls : 'icon_add',handler: onAddDictType},
			 	'-',
			 	{text: '修改字典类型',iconCls : 'icon_edit',handler: onUpdateDictType},
			 	'-',
			 	{text: '删除字典类型',iconCls : 'icon_delete',handler: onDeleteDictType}
		 	]
		});
    	dictTypeTree.on("contextmenu", function(node, ev){
            ev.preventDefault();
            node.select();
            currentActiveNode = node;
            treeNodeClick(node, ev);
            if (node.getDepth() == 0) {
            	menuTop1.showAt(ev.getXY());
            } else {
            	menuTop2.showAt(ev.getXY());
            }
       	});

		dictTypeTree.on("click", treeNodeClick);
		dictTypeTree.getRootNode().expand(false, false);	
	}
    </script>
</head>
  <body>
	<ext:ext onReady="initPage();">
	  	<ext:viewport layout="border" otherProperties="split: true">
	  		<ext:items>
  				<ext:panel title="数据字典管理" layout="border" region="center" border="false" iconCls="icon_plugin">
  					<ext:items>
 					<%-- 左边的字典类型树 --%>
	  				<ext:treePanel var="dictTypeTree" id="dictTypeTree" title="字典类型管理" border="true" rootVisible="true" autoScroll="true" 
	  					width="210" useArrows="false" otherProperties="split: true" region="west" margins="3 0 0 0" 
	      				root='new Ext.tree.AsyncTreeNode({id: "rootId", text : "字典类型管理", leaf: false, expanded: true })' 
	      				loader="new Ext.tree.TreeLoader({dataUrl : findDictTypeSupportTreeUrl})" collapsible="true">
	      				<ext:tbar>
	      					<ext:toolbarButton iconCls="icon_refresh" text="刷新" handler="function (){dictTypeTree.getRootNode().reload();}">
	      					</ext:toolbarButton>
	      				</ext:tbar>
	      				<ext:plugins>
	      					new Ext.ux.tree.TreeSearch({width: 120})
	      				</ext:plugins>
	   				</ext:treePanel>
	   				
					<%-- 字典项列表面板 --%>
   					<ext:panel var="dictEntryListPanel" layout="border" region="center" border="false" otherProperties="split: true">
   						<ext:items>
   							<%-------------------------------------------------------------------------------------------------
								定义查询条件面板  
							-------------------------------------------------------------------------------------------------%>
							<ext:formPanel var="queryFormPanel" id="queryFormPanel" title="查询条件" collapsible="true" 
								labelAlign="right" frame="true" region="north" height="66" border="false" 
								labelWidth="60" otherProperties="split: true" margins="3 0 0 0">
								<ext:items>
									<ext:container layout="column" defaults="{width: 186, layout: 'form'}" lazyInit="true">
										<ext:items>
											<ext:container lazyInit="true">
												<ext:items>
													<ext:textField id="query.dictId" fieldLabel="字典编号" width="110">
													</ext:textField>
												</ext:items>
											</ext:container>
											<ext:container lazyInit="true">
												<ext:items>
													<ext:textField id="query.dictName" fieldLabel="字典名称" width="110">
													</ext:textField>
												</ext:items>
											</ext:container>
											<ext:container layout="table" otherProperties="columnWidth: 1.0" lazyInit="true"
												defaults="{layout: 'form', border:false, columnWidth: 1.0}">
												<ext:items>
													<ext:button text="查询" iconCls="icon_search" style="margin-right:20px;" 
														handler="submitSearchDictHandler" otherProperties="minWidth: Common.config.buttonWidth.defaultButton">
													</ext:button>
													<ext:button text="刷新字典缓存" iconCls="icon_refresh"
														handler="refreshDictCache" otherProperties="minWidth: Common.config.buttonWidth.defaultButton">
													</ext:button>
												</ext:items>
											</ext:container>
										</ext:items>
									</ext:container>
								</ext:items>
							</ext:formPanel>
							<%-------------------------------------------------------------------------------------------------
								定义字典项列表  
							-------------------------------------------------------------------------------------------------%>
							<ext:gridPanel var="dictEntryGrid" id="dictEntryGrid" sm="dictEntrySm" region="center" iconCls="icon_grid" 
								autoExpandColumn="memo" border="true" listeners='{rowdblclick: onUpdateDictEntry}' collapsible="true"
								otherProperties="split: true, title: dictEntryGridTitle">
								<ext:tbar>
									<ext:toolbarSeparator></ext:toolbarSeparator>
									<ext:toolbarButton text="增加" iconCls="icon_add" handler="onAddDictEntry"
										otherProperties="minWidth: Common.config.buttonWidth.minButton">
									</ext:toolbarButton>
									<ext:toolbarButton text="修改" iconCls="icon_edit" handler="onUpdateDictEntry"
										otherProperties="minWidth: Common.config.buttonWidth.minButton">
									</ext:toolbarButton>
									<ext:toolbarButton text="删除" iconCls="icon_delete" handler="onDeleteDictEntry"
										otherProperties="minWidth: Common.config.buttonWidth.minButton">
									</ext:toolbarButton>
								</ext:tbar>
								<%-- 定义字典类型数据源 --%>
								<ext:jsonStore var="dictEntryStore" remoteSort="false" sortInfo="{field: 'sortNo', direction: 'ASC'}"
									root="result" otherProperties="url: listDictEntryUrl">
									<ext:fields>
										{name : 'dicttypeId',type : 'string'},
										{name : 'dictId',type : 'string'},
										{name : 'dictName',type : 'string'},
										{name : 'status',type : 'string'},
										{name : 'sortNo',type : 'int'},
										{name : 'memo',type : 'string'}
									</ext:fields>
								</ext:jsonStore>
								<%-- 定义字典类型列表的列头 --%>
								<ext:columnModel id="dictEntryCm">
									<ext:rowNumberer></ext:rowNumberer>
									<ext:checkboxSelectionModel var="dictEntrySm"></ext:checkboxSelectionModel>
									<ext:columnModel header="字典类型编号" dataIndex="dicttypeId" width="220" sortable="true" listFlag="false" lazyInit="true"></ext:columnModel>
									<ext:columnModel header="字典项编号" dataIndex="dictId" width="120" sortable="true" listFlag="false" lazyInit="true"></ext:columnModel>
									<ext:columnModel header="字典项名称" dataIndex="dictName" width="180" sortable="true" listFlag="false" lazyInit="true"></ext:columnModel>
									<ext:columnModel header="状态" dataIndex="status" width="60" sortable="true" listFlag="false" lazyInit="true"
										renderer="function(value){return Common.renderer.dictRender(dictEntryStatusDictArray, value);}"></ext:columnModel>
									<ext:columnModel header="显示序号" dataIndex="sortNo" sortable="true" width="80" listFlag="false" lazyInit="true"></ext:columnModel>
									<ext:columnModel header="备忘" dataIndex="memo" id="memo" listFlag="false" lazyInit="true"></ext:columnModel>
								</ext:columnModel>
								<%-- 定义字典类型列表的分页工具栏 --%>
								<ext:pagingToolbar key="bbar" var="dictEntryPagingBar" displayInfo="true" store="dictEntryStore" 
									otherProperties="pageSize: pageSize">
									<ext:plugins>new Ext.ux.Page.pageSize({beforeText : '显示', afterText : '条' })</ext:plugins>
								</ext:pagingToolbar>
							</ext:gridPanel>
						</ext:items>
						</ext:panel>
  					</ext:items>
  				</ext:panel>
	  		</ext:items>
	  	</ext:viewport>
	  </ext:ext>
  </body>
  
</html>
    